import React from "react";
import { Table } from "antd";
export default props => {
  const { columns, pagination, onChange } = props;
  const dataSource = props.dataSource.map((item, i) => {
    item.key = i;
    return item;
  });
  return (
    <Table
      bordered
      dataSource={dataSource}
      columns={columns}
      pagination={pagination}
      onChange={onChange}
    >
      {dataSource.map(item => {
        return <Table.Column key={item.key} />;
      })}
    </Table>
  );
};
